const Stream = require('node-rtsp-stream');
const exec = require('child_process');

process.on('message',function(m){
  console.log('收到的父进程传来的消息为。。。。。',m.message);
  // process.disconnect();
 })

var streamArr = [];

for (let index = 0; index < 6; index++) {
  var stream=null; 
  streamArr.push(stream);
};

streamArr.forEach((stream, index) => {
      
  if (stream) {
    console.log('22---------------------------');
    stream.wsServer.close();
    delete(stream);
  }
  streamArr[index] = new Stream({
    name: 'live',
    // streamUrl: JSON.parse(param.video)[index],
    streamUrl: 'rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov',
    wsPort: 28080 + index
  });
});
